<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul>
        <li class="item">1</li>
        <li class="item">2</li>
        <li class="item">3</li>
        <li class="item">4</li>
        <li class="item">5</li>
        <li class="item">6</li>
    </ul>
</body>
<script>
    function jq(selector){
        let lis=document.querySelectorAll(selector)
        for(let i=0;i<lis.length;i++){
            this[i]=lis[i]
        }
        this.length=lis.length
    }
    jq.prototype.on=function(type,callback){
       for(let i=0;i<this.length;i++){
           this[i].addEventListener(type,callback)
       }
    }
function $(selector){
    return new jq(selector)
}
let lis=$('.item') 
console.log(lis);

lis.on('click',function(){
    console.log('1');
    
})
</script>
</html>